package com.yonyou.cyxdms.basedata.service.controller.vehicleproduct;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyxdms.basedata.service.constant.BasedataCommonConstants;
import com.yonyou.cyxdms.basedata.service.constant.BasedataDictConstants;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.*;
import com.yonyou.cyxdms.basedata.service.service.brand.BrandService;
import com.yonyou.cyxdms.basedata.service.service.color.ColorService;
import com.yonyou.cyxdms.basedata.service.service.configure.PackageService;
import com.yonyou.cyxdms.basedata.service.service.model.ModelService;
import com.yonyou.cyxdms.basedata.service.service.option.VsOptionService;
import com.yonyou.cyxdms.basedata.service.service.product.VsProductService;
import com.yonyou.cyxdms.basedata.service.service.series.SeriesService;
import com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO;
import com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductDcsBrandVO;
import com.yonyou.cyxdms.basedata.service.vo.color.PageColorVO;
import com.yonyou.cyxdms.basedata.service.vo.model.GmsModelVO;
import com.yonyou.cyxdms.basedata.service.vo.model.ModelDictVO;
import com.yonyou.cyxdms.basedata.service.vo.option.VehicleProductOptionVO;
import com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO;
import com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO;
import com.yonyou.cyxdms.basedata.service.vo.productinfo.DcsVsProductVO;
import com.yonyou.cyxdms.basedata.service.vo.productinfo.VsProductVO;
import com.yonyou.cyxdms.basedata.service.vo.productprice.SaveProductPriceVO;
import com.yonyou.cyxdms.basedata.service.vo.series.SeriesDictVO;
import com.yonyou.cyxdms.basedata.service.vo.series.VehicleProductSeriesVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;

/**
 * dcs品牌车系车型配置的控制类
 *
 * @author renwd
 * @since 2019/7/18
 */

@Api(value = "BrandCarsModelsController", tags = "品牌车系车型配置的控制类")
@RestController
@RequestMapping("/dcs/vehicleProduct")
public class BrandCarsModelsDcsController {

    @Autowired
    BrandService brandService;

    @Autowired
    SeriesService seriesService;

    @Autowired
    ModelService modelService;

    @Autowired
    PackageService packageService;
    
    @Autowired
    VsOptionService vsOptionService;

    @Autowired
    VsProductService vsProductService;

    @Autowired
    private ColorService colorService;

    /**
     * dcs根据查询条件返回对应的品牌数据（pc）
     *
     * @param brandQueryDTO
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductBrandVO>
     * @author renwd
     * @since 2019/7/10
     */
    @GetMapping("/brands")
    @ApiOperation(notes = "dcs根据查询条件返回对应的品牌数据", value = "dcs根据查询条件返回对应的品牌数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    public IPage<VehicleProductDcsBrandVO> queryVehicleProductBrand(@RequestParam("pageNum") Long current,
                                                                    @RequestParam("limit") Long size,
                                                                    BrandQueryDTO brandQueryDTO) {
        Page<VehicleProductDcsBrandVO> page = new Page<>(current, size);
        Map<String, Object> queryParam = brandQueryDTO.toMaps();
        return brandService.queryVehicleProductDcsBrand(page, queryParam);
    }

    /**
     * dcs新增品牌
     *
     * @param brandDto
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/11
     */
    @ApiOperation(notes = "dcs新增品牌", value = "dcs新增品牌")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PostMapping("/brands")
    public Integer addBrand(@Valid @RequestBody BrandModifyDTO brandDto) {
        return brandService.addDcsBrand(brandDto);
    }


    /**
     * dcs品牌修改
     *
     * @param id
     * @param brandDto
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/19
     */
    @ApiOperation(notes = "dcs品牌修改", value = "dcs品牌修改")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PutMapping("/brands/{id}")
    public Integer modifyDcsBrand(@PathVariable("id") Long id, @RequestBody BrandModifyDTO brandDto) {
        return brandService.modifyDcsBrand(id, brandDto);
    }

    /**
     * dcs品系型新增编辑品牌下拉框（厂端有效）
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @author renwd
     * @since 2019/7/19
     */
    @ApiOperation(notes = "dcs品系型新增编辑品牌下拉框（厂端有效）", value = "dcs品系型新增编辑品牌下拉框（厂端有效）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brandsdict")
    public List<BrandDictVO> queryDcsBrandDict(@RequestParam Map<String, Object> queryParam) {
        return brandService.queryDcsBrandDict(queryParam);
    }

    /**
     * dcs品系型查询界面品牌下拉框（厂端所有）
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @author renwd
     * @since 2019/7/17
     */
    @ApiOperation(notes = "dcs品系型查询界面品牌下拉框（厂端所有）", value = "dcs品系型查询界面品牌下拉框（厂端所有）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/queryBrandDictAll")
    public List<BrandDictVO> queryBrandsAll(@RequestParam Map<String, Object> queryParam) {
        return brandService.queryBrandsAll(queryParam);
    }

    /**
     * dcs品牌导出
     *
     * @param queryParam
     * @param request
     * @param response
     * @return void
     * @author renwd
     * @since 2019/7/19
     */
    @ApiOperation(notes = "dcs品牌导出", value = "dcs品牌导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brands/export/excel")
    public void exportDcsBrands(@RequestParam Map<String, Object> queryParam, HttpServletRequest request,
                                HttpServletResponse response) {
//        queryParam.put(BasedataCommonConstants.DATA_SOURCES, BasedataDictConstants.DATA_SOURCES_BY_GROUP);
        brandService.exportExcelForBrand(queryParam, request, response);
    }

    /**
     * dcs导入品牌
     *
     * @param importFile
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.BrandImportDTO>
     * @author renwd
     * @since 2019/7/22
     */
    @ApiOperation(notes = "dcs导入品牌", value = "dcs导入品牌")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PostMapping("/brands/import")
    public List<BrandImportDTO> importBrand(@RequestParam(value = "file") MultipartFile importFile) {
        return brandService.importBrand(importFile);
    }

    /**
     * dcs根据查询条件返回对应的车系数据
     *
     * @param current
     * @param size
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.series.VehicleProductSeriesVO>
     * @author renwd
     * @since 2019/7/18
     */
    @GetMapping("/seriess")
    @ApiOperation(notes = "dcs根据查询条件返回对应的车系数据", value = "dcs根据查询条件返回对应的车系数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    public IPage<VehicleProductSeriesVO> queryVehicleProductSeries(@RequestParam("pageNum") Long current, @RequestParam("limit") Long size, @RequestParam Map<String, Object> queryParam) {
        Page<VehicleProductSeriesVO> page = new Page(current, size);
        return seriesService.queryDcsVehicleProductBrand(page, queryParam);
    }

    /**
     * dcs新增车系
     *
     * @param seriesModifyDTO
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/11
     */
    @ApiOperation(notes = "dcs新增车系", value = "dcs新增车系")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PostMapping("/seriess")
    public Integer addSeries(@Valid @RequestBody SeriesModifyDTO seriesModifyDTO) {
        return seriesService.addDcsSeries(seriesModifyDTO);
    }

    /**
     * dcs修改车系
     *
     * @param id
     * @param seriesModifyDTO
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/16
     */
    @ApiOperation(notes = "dcs修改车系", value = "dcs修改车系")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PutMapping("/seriess/{id}")
    public Integer modifySeries(@PathVariable("id") Long id, @RequestBody SeriesModifyDTO seriesModifyDTO) {
        return seriesService.modifyDcsSeries(id, seriesModifyDTO);
    }

    /**
     * dcs品系型查询界面车系下拉框
     *
     * @param brandsid
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.series.SeriesDictVO>
     * @author renwd
     * @since 2019/7/19
     */
    @ApiOperation(notes = "dcs品系型查询界面车系下拉框", value = "dcs品系型查询界面车系下拉框")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brandsdict/{brandsid}/seriessdictAll")
    public List<SeriesDictVO> querySeriesDict(@PathVariable String brandsid, @RequestParam Map<String, Object> queryParam) {
        queryParam.put("code", brandsid);
        return seriesService.queryDcsSeriesDict(queryParam);
    }

    /**
     * dcs车系导出
     *
     * @param queryParam
     * @param request
     * @param response
     * @return void
     * @author renwd
     * @since 2019/7/15
     */
    @ApiOperation(notes = "dcs车系导出", value = "dcs车系导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/seriess/export/excel")
    public void exportSeries(@RequestParam Map<String, Object> queryParam, HttpServletRequest request,
                             HttpServletResponse response) {
        seriesService.exportExcelForSeries(queryParam, request, response);
    }

    /**
     * dcs导入车系
     *
     * @param importFile
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.SeriesImportDTO>
     * @author renwd
     * @since 2019/7/22
     */
    @ApiOperation(notes = "dcs导入车系", value = "dcs导入车系")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PostMapping("/seriess/import")
    public List<SeriesImportDTO> importSeries(@RequestParam(value = "file") MultipartFile importFile) {
        return seriesService.importSeries(importFile);
    }

    /**
     * dcs根据查询条件返回对应的车型数据
     *
     * @param current
     * @param size
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.model.GmsModelVO>
     * @author renwd
     * @since 2019/7/18
     */
    @ApiOperation(notes = "dcs根据查询条件返回对应的车型数据", value = "dcs根据查询条件返回对应的车型数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/models")
    public IPage<GmsModelVO> queryVehicleProductModel(@RequestParam("pageNum") Long current, @RequestParam("limit") Long size, @RequestParam Map<String, Object> queryParam) {
        Page<VehicleProductSeriesVO> page = new Page(current, size);
        return modelService.queryVehicleProductDcsModel(page, queryParam);
    }

    /**
     * dcs新增车型
     *
     * @param modelDTO
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/11
     */
    @ApiOperation(notes = "dcs新增车型", value = "dcs新增车型")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PostMapping("/models")
    public Integer addModel(@Valid @RequestBody ModelModifyDTO modelDTO) {
        return modelService.addDcsModel(modelDTO);
    }

    /**
     * dcs修改车型
     *
     * @param id
     * @param modelDto
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/16
     */
    @ApiOperation(notes = "dcs修改车型", value = "dcs修改车型")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PutMapping("/models/{id}")
    public Integer modifyModel(@PathVariable("id") Long id, @RequestBody ModelModifyDTO modelDto) {
        return modelService.modifyDcsModel(id, modelDto);
    }

    /**
     * dcs车型导出
     *
     * @param queryParam
     * @param request
     * @param response
     * @return void
     * @author renwd
     * @since 2019/7/15
     */
    @ApiOperation(notes = "dcs车型导出", value = "dcs车型导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/models/export/excel")
    public void exportModels(@RequestParam Map<String, Object> queryParam, HttpServletRequest request,
                             HttpServletResponse response) {
        modelService.exportExcelForModel(queryParam, request, response);
    }

    /**
     * dcs有效车型下拉框
     *
     * @param seriessid
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.model.ModelDictVO>
     * @author renwd
     * @since 2019/7/19
     */
    @ApiOperation(notes = "dcs有效车型下拉框", value = "有效车型下拉框")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brandsdict/{brandsid}/seriessdict/{seriessid}/modelsdict")
    public List<ModelDictVO> queryModelDict(@PathVariable("seriessid") String seriessid, @RequestParam Map<String, Object> queryParam) {
        queryParam.put("code", seriessid);
        queryParam.put(BasedataCommonConstants.DATA_SOURCES, BasedataDictConstants.DATA_SOURCES_BY_GROUP);
        return modelService.queryModelDict(queryParam);
    }

    /**
     * dcs根据查询条件返回对应的配置数据
     *
     * @param current
     * @param size
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO>
     * @author renwd
     * @since 2019/7/19
     */
    @ApiOperation(notes = "dcs根据查询条件返回对应的配置数据", value = "dcs根据查询条件返回对应的配置数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/packages")
    public IPage<VehicleProductPackageVO> queryVehicleProductPackage(@RequestParam("pageNum") Long current, @RequestParam("limit") Long size, @RequestParam Map<String, Object> queryParam) {
        Page<VehicleProductPackageVO> page = new Page(current, size);
        return packageService.queryVehicleProductDcsPackage(page, queryParam);
    }
    
    /**
     * dcs根据查询条件返回对应的选装数据
     *
     * @param current
     * @param size
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.packages.VehicleProductPackageVO>
     * @author zhangys
     * @since 2020/2/24
     */
    @ApiOperation(notes = "dcs根据查询条件返回对应的选装数据", value = "dcs根据查询条件返回对应的选装数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/options")
    public IPage<VehicleProductOptionVO> queryVehicleProductOption(@RequestParam("pageNum") Long current, @RequestParam("limit") Long size, @RequestParam Map<String, Object> queryParam) {
        Page<VehicleProductOptionVO> page = new Page(current, size);
        return vsOptionService.queryVehicleProductDcsOption(page, queryParam);
    }

    /**
     * dcs新增配置
     *
     * @param packageModifyDTO
     * @return java.lang.Integer
     * @author Tansj
     * @since 2019/11/18
     */
    @ApiOperation(notes = "dcs新增配置", value = "dcs新增配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PostMapping("/packages")
    public Integer addPackage(@Valid @RequestBody PackageModifyDTO packageModifyDTO) {
        return packageService.addDcsPackage(packageModifyDTO);
    }
    
    /**
     * dcs新增选装
     *
     * @param optionModifyDTO
     * @return java.lang.Integer
     * @author zhangys
     * @since 2020/2/24
     */
    @ApiOperation(notes = "dcs新增选装", value = "dcs新增选装")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PostMapping("/options")
    public Integer addOption(@Valid @RequestBody OptionModifyDTO optionModifyDTO) {
        return vsOptionService.addDcsOption(optionModifyDTO);
    }

    /**
     * dcs修改配置信息
     *
     * @param id
     * @param packageModifyDTO
     * @return java.lang.Integer
     * @author Tansj
     * @since 2019/11/18
     */
    @ApiOperation(notes = "dcs修改配置信息", value = "dcs修改配置信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PutMapping("/packages/{id}")
    public Integer modifyConfig(@PathVariable("id") Long id, @RequestBody PackageModifyDTO packageModifyDTO) {
        return packageService.modifyDcsConfig(id, packageModifyDTO);
    }
    
    /**
     * dcs修改选装信息
     *
     * @param id
     * @param optionModifyDTO
     * @return java.lang.Integer
     * @author zhangys
     * @since 2020/2/24
     */
    @ApiOperation(notes = "dcs修改选装信息", value = "dcs修改选装信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PutMapping("/options/{id}")
    public Integer modifyOption(@PathVariable("id") Long id, @RequestBody OptionModifyDTO optionModifyDTO) {
        return vsOptionService.modifyDcsOption(id, optionModifyDTO);
    }

    /**
     * dcs配置导出
     *
     * @param queryParam
     * @param request
     * @param response
     * @return void
     * @author renwd
     * @since 2019/7/15
     */
    @ApiOperation(notes = "dcs配置导出", value = "dcs配置导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/packages/export/excel")
    public void exportConfis(@RequestParam Map<String, Object> queryParam, HttpServletRequest request,
                             HttpServletResponse response) {
        packageService.exportExcelForPackage(queryParam, request, response);
    }



    /**
     * dcs配置导出
     *
     * @param queryParam
     * @param request
     * @param response
     * @return void
     * @author wangsht
     * @since 2020/12/15
     */
    @ApiOperation(notes = "dcs选装导出", value = "dcs选装导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/options/export/excel")
    public void exportOptions(@RequestParam Map<String, Object> queryParam, HttpServletRequest request,
                             HttpServletResponse response) {
        packageService.exportExcelForOption(queryParam, request, response);
    }

    /**
     * dcs有效配置下拉框
     *
     * @param modelsid
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO>
     * @author renwd
     * @since 2019/7/16
     */
    @ApiOperation(notes = "dcs有效配置下拉框", value = "dcs有效配置下拉框")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brandsdict/{brandsid}/seriessdict/{seriessid}/modelsdict/{modelsid}/packagesdict")
    public List<PackageDictVO> queryPackageDict(@PathVariable("modelsid") String modelsid, @RequestParam Map<String, Object> queryParam) {
        queryParam.put("code", modelsid);
        queryParam.put(BasedataCommonConstants.DATA_SOURCES, BasedataDictConstants.DATA_SOURCES_BY_GROUP);
        return packageService.queryPackageDict(queryParam);
    }


    @ApiOperation(notes = "皮卡专用-配置下拉框", value = "皮卡专用-配置下拉框")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brandsdict/{brandsid}/seriessdict/{seriessid}/modelsdict/{modelsid}/packagesdictpk")
    public List<PackageDictVO> queryPackageDictPk(@PathVariable("modelsid") String modelsid, @RequestParam Map<String, Object> queryParam) {
        queryParam.put("code", modelsid);
//        queryParam.put(BasedataCommonConstants.DATA_SOURCES, BasedataDictConstants.DATA_SOURCES_BY_GROUP);
        return packageService.queryPackageDict(queryParam);
    }

    /**
     * Dcs车辆主数据
     *
     * @param pageNum
     * @param pageSize
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.productinfo.VsProductVO>
     * @author renwd
     * @since 2019/7/17
     */
    @ApiOperation(value = "Dcs车辆主数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "string", paramType = "header")
    })
    @GetMapping("/productInfo/list")
    public IPage<DcsVsProductVO> queryDcsProductInfo(@RequestParam("pageNum") Long pageNum,
                                                     @RequestParam("limit") Long pageSize,
                                                     @RequestParam Map<String, Object> queryParam) {
        Page<DcsVsProductVO> page = new Page<>(pageNum, pageSize);
        return vsProductService.queryDcsProductInfo(page, queryParam);
    }
    
    /**
     * Dcs车辆主数据
     *
     * @param pageNum
     * @param pageSize
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.productinfo.VsProductVO>
     * @author zys
     * @since 2020/2/11
     */
    @ApiOperation(value = "Dcs车辆主数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "string", paramType = "header")
    })
    @GetMapping("/productInfo/listV2")
    public IPage<DcsVsProductVO> queryDcsProductInfoV2(@RequestParam("pageNum") Long pageNum,
                                                     @RequestParam("limit") Long pageSize,
                                                     @RequestParam Map<String, Object> queryParam) {
        Page<DcsVsProductVO> page = new Page<>(pageNum, pageSize);
        return vsProductService.queryDcsProductInfoV2(page, queryParam);
    }

    /**
     * 添加或更新-车辆主数据
     *
     * @param saveProductPriceVO
     * @author lijun
     * @since 2019/12/17
     */
    @ApiOperation(value = "添加或更新-车辆主数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "string", paramType = "header")
    })
    @PostMapping("/productInfo/saveOrUpdate")
    public Integer saveProductInfo(@RequestBody SaveProductPriceVO saveProductPriceVO) {
        return vsProductService.saveProductInfo(saveProductPriceVO);
    }
    
    /**
     * 添加或更新-车辆主数据
     *
     * @param saveProductPriceVO
     * @author zys
     * @since 2020/2/11
     */
    @ApiOperation(value = "添加或更新-车辆主数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "string", paramType = "header")
    })
    @PostMapping("/productInfo/saveOrUpdateV2")
    public Integer saveProductInfoV2(@RequestBody SaveProductPriceVO saveProductPriceVO) {
    	return vsProductService.saveProductInfoV2(saveProductPriceVO);
    }

    /**
     * 新增编辑界面dcs品牌下拉框
     *
     * @author lijun
     * @since 2019/11/15
     */
    @ApiOperation(notes = "新增编辑界面dcs品牌下拉框", value = "新增编辑界面dcs品牌下拉框")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/queryBrandDictOwner")
    public List<BrandDictVO> queryBrandDictOwner() {
        return brandService.queryDcsBrandDict();
    }

    /**
     * 新增编辑界面dcs车系下拉框
     *
     * @param brandsId
     * @author lijun
     * @since 2019/11/18
     */
    @ApiOperation(notes = "新增编辑界面dcs车系下拉框", value = "新增编辑界面dcs车系下拉框")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brandsdict/{brandsId}/queryBrandDictOwner")
    public List<SeriesDictVO> querySeriesDictOwner(@PathVariable (value = "brandsId") String brandsId) {
        return seriesService.queryDcsSeriesDictOwner(brandsId);
    }

    /**
     * 新增编辑界面dcs车型下拉框
     *
     * @param brandsId
     * @author lijun
     * @since 2019/11/18
     */
    @ApiOperation(notes = "新增编辑界面dcs车型下拉框", value = "新增编辑界面dcs车型下拉框")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brandsdict/{brandsId}/seriessdictAll/{seriesId}/queryBrandDictOwner")
    public List<ModelDictVO> queryModelDictOwner(@PathVariable (value = "brandsId") String brandsId,
                                                 @PathVariable (value = "seriesId") String seriesId) {
        return modelService.queryDcsModelDictOwner(brandsId, seriesId);
    }

    /**
     * 品系型查询界面dcs车型下拉框
     *
     * @param brandsId
     * @param seriesId
     * @author lijun
     * @since 2019/11/18
     */
    @ApiOperation(notes = "品系型查询界面车型下拉框", value = "品系型查询界面车型下拉框")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/brandsdict/{brandsId}/seriessdictAll/{seriesId}/modelsdictAll")
    public List<ModelDictVO> queryDcsModelDictAll(@PathVariable (value = "brandsId") String brandsId,
                                               @PathVariable (value = "seriesId") String seriesId) {
        return modelService.queryDcsModelDictAll(brandsId, seriesId);
    }

    /**
     * 根据经销商授权显示车型
     *
     * @param  queryParam 显示的车型对象map格式
     * @author wangsht
     * @since 2020-12-17
     */
    @GetMapping("/brandsdict/seriessdictAll/modelsdictAll")
    public List<ModelDictVO> queryDcsModelDictAll(@RequestParam Map<String, Object> queryParam) {
        return modelService.queryDcsModelDictAll(queryParam);
    }



    /**
     * Dcs车辆颜色
     *
     * @param current
     * @param size
     * @param colorQueryDTO
     * @author lijun
     * @since 2019/11/18
     */
    @ApiOperation(value = "Dcs车辆颜色", notes = "Dcs车辆颜色")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @GetMapping("/colors")
    public IPage<PageColorVO> queryDcsColor(@RequestParam("pageNum") Long current, @RequestParam("limit") Long size,
                                         @Valid ColorQueryDTO colorQueryDTO) {
        Page<PageColorVO> page = new Page<>(current, size);
        return colorService.queryDcsColor(page, colorQueryDTO);
    }

    /**
     * Dcs新增颜色
     *
     * @param colorDTO
     * @return java.lang.Integer
     * @author lijun
     * @since 2019/7/17
     */
    @ApiOperation(value = "Dcs新增颜色", notes = "Dcs新增颜色")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PostMapping("/colors")
    public Integer addDcsColor(@RequestBody CarColorDTO colorDTO) {
        return colorService.addDcsColor(colorDTO);
    }

    /**
     * Dcs修改颜色
     *
     * @param id
     * @param colorDTO
     * @return java.lang.Integer
     * @author lijun
     * @since 2019/7/17
     */
    @ApiOperation(value = "Dcs修改颜色", notes = "Dcs修改颜色")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", required = true, dataType = "Long", paramType = "header", value = "userId"),
    })
    @PutMapping("/colors/{id}")
    public Integer updateDcsColor(@PathVariable("id") Long id, @RequestBody CarColorDTO colorDTO) {
        return colorService.updateDcsColor(id, colorDTO);
    }
}
